//
//  personalView.m
//  reSearchDemo
//
//  Created by 科技 on 15/8/7.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "personalView.h"

@implementation personalView 
+(personalView *)instanceView {
    NSArray* nibView =  [[NSBundle mainBundle] loadNibNamed:@"personalView" owner:nil options:nil];
    
    
    
    return [nibView objectAtIndex:0];
}
-(void)drawRect:(CGRect)rect{
    self.IDNumberTF.delegate=self;
    self.IDNumberTF.tag=1;
    
    self.PhoneNumberTF.delegate=self;
    self.PhoneNumberTF.tag=2;
    
    
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    
    NSString *text = textField.text;
    NSInteger count = text.length + string.length;
    if (textField == self.IDNumberTF && count > 18) {
        return NO;
    }
    
    if (textField == self.PhoneNumberTF && count > 11) {
        return NO;
    }
    
    return YES;

}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    
    [self.nameTF resignFirstResponder];
    [self.IDNumberTF resignFirstResponder];
    [self.PhoneNumberTF resignFirstResponder];
    [self.streetTF resignFirstResponder];
   
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
